/* 
 * File:   MenuNewGame.h
 * Author: agu
 *
 * Created on 16 de junio de 2014, 20:21
 */

#ifndef MENUNEWGAME_H
#define	MENUNEWGAME_H
#include <gtkmm-3.0/gtkmm.h>
#include <string>
#include <vector>
#include "client_socket.h"
#include "client_WatingRoom.h"
using std::string;
using std::vector;
class MenuNewGame : public Gtk::Window {
public:
    MenuNewGame();
    void run();
    void setWindowsBack(Gtk::Window *windowBack);
    void setSocket(Client_socket s);
    ~MenuNewGame();
private:
    void loadWidgets();
    void connectWidgets();
    void close();
    void back();
    void accept();
    void ok();
    void createModel();
    void onComboChanged();
    void send(const string msj);
    string recv();
    void getCampaignsInfo();
    void loadCampaignsInfo(Gtk::TreeModel::Row row);
    vector<string> getElementos(const string& linea,char separador);
    string agregarLargo(string buffer);
    Glib::RefPtr<Gtk::Builder> builder;
    Gtk::Window* window, *windowsBack;
    Gtk::Button *buttonBack, *buttonAccept,*buttonOk;
    Gtk::TextView *textView;
    Gtk::Entry* entryName;
    Gtk::ComboBox *comboCampaign;
    Gtk::Image* image;
    Gtk::MessageDialog *message;
    WatingRoom watingRoom;
    Client_socket socket;
    vector<vector<string>>campaignsInfo;
    int campSelect;
    class ModelColumnsCampanias : public Gtk::TreeModel::ColumnRecord {
    public:

        ModelColumnsCampanias() {
            add(colCampName);
        }
        Gtk::TreeModelColumn<Glib::ustring> colCampName;
    };
    ModelColumnsCampanias columnsCampanias;
    Glib::RefPtr<Gtk::ListStore> refTreeModelCampanias;
};

#endif	/* MENUNEWGAME_H */

